<!--售票员层级差异待协查-->
<template>
  <div class="JieZhangDanAndSCCengji HuikuiInfo el-card is-always-shadow el-card__body">
    <el-dialog
      title="操作回馈信息"
      :visible.sync="dialogVisible"
      @close="closed"
      width="950px">
      <div style="line-height: 40px;background-color: #fcf7f7;padding-left: 15px">
        <span>线路：</span><span>{{getLineName(formData.lineCode)}}</span>
        <span style="margin-left: 20px">站点：</span><span>{{getStationName(formData.lineCode,formData.stationCode)}}</span>
        <span style="margin-left: 20px">售票员：</span><span>{{formData.conductorPersonName}}</span>
        <span style="margin-left: 20px"> 设备操作号：</span><span>{{formData.equipmentNumber}}</span>
        <span style="margin-left: 20px"> 下发协查时间：</span><span>{{formData.sendTime}}</span>
      </div>
      <avue-form v-if="isReload" class="JieZhangDanAndSCCengjiForm" :option="option" v-model="formData" @submit="handleSubmit">
        <template slot-scope="scope" slot="list1" >
          <avue-crud
            ref="crud"
            :option="cols1"
            :data="formData.list1">
          </avue-crud>
        </template>
        <template slot-scope="scope" slot="list2" >
          <avue-crud
            ref="crud"
            :option="cols2"
            :data="formData.list2">
          </avue-crud>
        </template>
        <template slot-scope="scope" slot="menuForm" >
          <el-button type="primary" @click="handleSubmit" >一键替换</el-button>
          <el-button  @click="closed" >返回</el-button>
        </template>
      </avue-form>
    </el-dialog>
  </div>
</template>


<script>
  import {getForm, postForm} from '@/api/gen/gen'
  import ExportJsonExcel from "js-export-excel";
  import {
    clearSelect,
    electromeReasons,
    getStationName,
    getLineName,
    getElectromeReasons
  } from "../../../../../api/subwayRat/commonCheck";
  import {
    cols1,
    cols2,
    getDXCSwAuConductorHierarchyAmountDifferenceList,
    getMondifyData1,
    getMondifyData2,
    replaceShoupiaoyuanCJCYDXC
  } from "../../../../../api/subwayRat/conductorDifferences/conductorTicketChaYiShenhe/shouPiaoYuanCJDXY/shoupiaoyuanCJCYDXC/LCAndACCCengJiCYDXC";

  export default {
    components:{
    },
    data() {
      return {
        isReload:true,
        showType:1,
        cols1:cols1,
        cols2:cols2,
        replaceStatus:1,
        dialogVisible:true,
        formData:{
          list1:[],
          list2:[],
        },
        option:{

        }
    }
    },
    created() {

    },
    methods: {
      getStationName,getLineName,
      handleSubmit(){
        replaceShoupiaoyuanCJCYDXC({ids:this.formData.id}).then(res=>{
          if(res.data.code==0){
            this.$message.success("操作成功！");
            this.closed();
            this.$parent.getList();
          }else{
            this.$message.error(res.data.msg);
          }
        })
      },
      recallShow(row){
        this.formData={}
        Object.assign(this.formData,row);
        this.formData.qfReplyReason=getElectromeReasons(Number(this.formData.qfReplyReason));
        this.formData.jdReplyReason=getElectromeReasons(Number(this.formData.jdReplyReason));
        let mondify1=getMondifyData1(row);
        let mondify2=getMondifyData2(row);
        this.formData.list1=mondify1;
        this.formData.list2=mondify2;
        this.getOption();
      },
      closed(){
        this.dialogVisible=false;
        this.$parent.isShowDia=false;
      },
      getOption(){

        let group1={
          icon:'',
          sortable:true,
          label: '层级差异信息',
          // collapse:false,
          prop: 'group1',
          indexLabel:"#",
          column: [{
            label: '',
            prop: 'list1',
            formslot: true,
          }
          ]
        };
        let group2={
          icon:'',
          sortable:true,
          label: '层级差异协查与回馈',
          // collapse:false,
          prop: 'group2',
          indexLabel:"#",
          column: [{
            label: '',
            prop: 'list2',
            formslot: true,
          }
          ]
        };

        let group3={
          icon:'',
          label: '',
          // collapse:false,
          prop: 'group3',
          column: [{
            label: '机电专业回馈差异原因',
            prop: 'jdReplyReason',
            labelWidth:200,
            disabled: true,
            type:'select',
            dicData:electromeReasons(),
          },
            {
              label: '机电专业详细描述',
              prop: 'jdReplyDetail',
              type: 'textarea',
              labelWidth:150,
              disabled: true
            },
            {
              label: '清分管理人员回馈差异原因',
              prop: 'qfReplyReason',
              labelWidth:200,
              disabled: true,
              type:'select',
              dicData:electromeReasons(),
            },
            {
              label: '清分管理人员详细描述',
              prop: 'qfReplyDetail',
              type: 'textarea',
              labelWidth:150,
              disabled: true //回馈过的和替换过的紧张修改
            },
          ]
        };

        this.option={
          submitBtn:false,
          emptyBtn:false,
          span:12,
          group:[]
        } ;
        this.option.group.push(group1);
        this.option.group.push(group2);
        this.option.group.push(group3);

        this.isReload=false;
        this.$nextTick(()=>{
          this.isReload=true;
        })
      }
    },
    mounted() {

    }
  }
</script>
<style lang="scss">
  .JieZhangDanAndSCCengji{
    .JieZhangDanAndSCCengjiForm{
      .avue-group[index='1']{
        .el-form-item{
          min-width: 450px;
        }
        .avue-form__row{
          width: 100%;
        }
      }
      .avue-group[index='2']{
        .el-form-item{
          min-width: 450px;
        }
        .avue-form__row{
          width: 100%;
        }
      }
      .avue-group[index='4']{
        .el-form-item{
          min-width: 450px;
        }
        .avue-form__row{
          width: 70%;
        }
      }
    }
  }

</style>
